package com.alleniverrui.mailsend.controller;


import com.alleniverrui.mailsend.entity.CheckNumber;
import com.alleniverrui.mailsend.service.MailService;
import com.alleniverrui.mailsend.utils.R;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author root
 */
@RestController
public class MailController {

    @Autowired
    MailService mailService;

    @GetMapping("/mail/send")
    private R send(String email) throws Exception{
//        email="1373716338@qq.com";
        CheckNumber checkNumber = mailService.sendCheckNumber(email);
//        return checkNumber;
       return R.ok("验证码已发送，请前往邮箱查看!");
    }


}
